(C) 1996 AROS - The Amiga Replacement OS


NAME
APTR RawDoFmt()
SYNOPSIS
STRPTR FormatString
APTR DataStream
VOID_FUNC PutChProc
APTR PutChData

LOCATION
In SysBase at offset 87
FUNCTION
printf-style formatting function with callback hook.

INPUTS
FormatString
Pointer to the format string with any of the following stream formatting options allowed: %[leftalign][minwidth.][maxwidth][size][type]
leftalign
'-' means align left. Default: align right.
minwidth
minimum width of field. Defaults to 0.
maxwidth
maximum width of field (for strings only). Defaults to no limit.
size
'l' means longword. Defaults to word.
type
'b' BCPL string. A BPTR to a one byte byte count followed by the characters. 'c' single character. 'd' signed decimal number. 's' C string. NUL terminated. 'u' unsigned decimal number. 'x' unsigned sedecimal number.
DataStream
Array of the data items.
PutChProc
Callback function. Called for each character, including the NUL terminator.
PutChData
Data propagated to each call of the callback hook.
RESULT
Pointer to the rest of the DataStream.

NOTES
The field size defaults to words which may be different from the default integer size of the compiler.

EXAMPLE
build a sprintf style function

static void callback(UBYTE chr, UBYTE **data)
{   *(*data)++=chr;   }

void my_sprintf(UBYTE *buffer, UBYTE *format, ...)
{   RawDoFmt(format, &format+1, &callback, &buffer);   }

BUGS
PutChData cannot be modified from the callback hook.

SEE ALSO
INTERNALS
HISTORY
12.05.1997 aros
Fixed all headers
01.01.1997 ldp
Committed Amiga native (support) code

Changed clib to proto

10.12.1996 aros
Moved all #include's in the first column so makedepend can see it.
24.10.1996 aros
Use the official AROS macros over the __AROS versions.
23.10.1996 aros
Renamed AROS macros from XYZ to AROS_XYZ, so we know what they are

Removed UDIVMOD10()

19.10.1996 aros
Include <aros/machine.h> instead of machine.h
13.09.1996 digulla
Use IPTR
13.08.1996 digulla
Replaced __AROS_LA by __AROS_LHA Replaced some __AROS_LH*I by __AROS_LH* Sorted and added includes
01.08.1996 digulla
Added standard header for all files
01.08.1996 digulla
Added copyright notics and made headers conform
28.07.1996 digulla
Initial revision
28.07.1996 digulla
First CVS version of AROS